package net.csdn.business.notify.api.controller;



import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import net.csdn.business.notify.common.model.dto.NewNotifyPrivateLetterDTO;
import net.csdn.business.notify.common.model.dto.UpdateNotifyPrivateLetterDTO;
import net.csdn.business.notify.common.model.query.NotifyPrivateLetterQuery;
import net.csdn.business.notify.common.model.vo.NotifyPrivateLetterVO;
import net.csdn.business.notify.api.service.INotifyPrivateLetterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 通知中心-用户私信Controller
 * 
 * @author ruoyi
 * @date 2023-11-27
 */
@RestController
@RequestMapping("/api/v1/notify/private")
public class NotifyPrivateLetterController
{
    @Autowired
    private INotifyPrivateLetterService notifyPrivateLetterService;

    /**
     * 分页查询通知中心-用户私信列表
     */
    @PostMapping("/list")
    public Page<NotifyPrivateLetterVO> findPageList(@RequestBody NotifyPrivateLetterQuery query)
    {
        return notifyPrivateLetterService.findPageList(query);
    }


    /**
     * 根据id获取通知中心-用户私信详细信息
     */
    @GetMapping(value = "/{id}")
    public NotifyPrivateLetterVO getInfo(@PathVariable("id") String id)
    {
        return notifyPrivateLetterService.selectNotifyPrivateLetterById(id);
    }


    /**
     * 删除通知中心-用户私信
     */
	@DeleteMapping("/{id}")
    public Integer remove(@PathVariable("id")  String id)
    {
        return notifyPrivateLetterService.deleteNotifyPrivateLetterById(id);
    }
}
